home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9887 < prev    next >
Encoding:
Text File  |  1996-08-05  |  942 b   |  28 lines

  1. Newsgroups: comp.os.linux.help,comp.lang.c
  2. Path: zeno.fit.edu!ccurtis
  3. From: ccurtis@ee.fit.edu (Christopher W. Curtis)
  4. Subject: strncpy bug?
  5. Message-ID: <ccurtis.826776589@ee.fit.edu>
  6. Sender: news@zeno.fit.edu (USENET NEWS SYSTEM)
  7. Nntp-Posting-Host: pram.ee.fit.edu
  8. Organization: Florida Tech, CP/EE Dept.
  9. Date: Thu, 14 Mar 1996 04:09:49 GMT
  10.  
  11. Hi.
  12.  
  13. I was wondering if this is a Linux thing (kernel 1.2.1) or a
  14. more general 'problem'.  If you call strncpy as such:
  15.     strncpy( dest, NULL, x );
  16. it will seg fault.  Is this common among all platforms, or
  17. just with Linux?
  18.  
  19. The man page says nothing about it, but I would have presumed
  20. that if str[n]cpy were passed NULL as a source, it would
  21. merely catenate the destination.  Did I presume wrong?
  22.  
  23. Thanks,
  24. --
  25. Christopher Curtis, Sun SysAdmin - http://www.ee.fit.edu/users/ccurtis
  26. Florida Institute of Technology  - telnet bofh.engr.wisc.edu 666
  27. Melbourne, Florida  USA          - Member, Team OS/2
  28.